<template>
  <div class="container">
    <img
      style="cursor: pointer"
      @click="goSource"
      src="@/assets/login_images/source.png"
      alt=""
    />
  </div>
</template>

<script>
import { sourceData } from "@/api/source";
export default {
  name: "index",
  mounted() {
    this.goSource();
  },
  methods: {
    goSource() {
      sourceData({ userId: this.$store.state.user.USER_INFO.id }).then(
        (response) => {
          if (response.code == 200) {
            let a = document.createElement("a");
            a.href = `${response.result.url}?encryptHex=${response.result.encryptHex}&areaCode=${response.result.areaCode}&json=${response.result.json}&pinyin=${response.result.pinyin}&minioUrl=${response.result.minioUrl}`;
            a.target = "_blank";
            a.click();
          }
        }
      );
    },
  },
};
</script>

<style scoped>
.container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10%;
}
</style>
